package com.jiezuo.flowable.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jiezuo.flowable.entity.MyFormDesign;
import org.flowable.engine.form.FormProperty;

import java.util.List;

/**
 * @description 表单设计器
 * @author 庞留杰
 * @date 2024/03/06 16:49
 * @version V1.0
 **/
public interface MyFormDesignService extends IService<MyFormDesign> {

    IPage<MyFormDesign> findPage(Page initMpPage, MyFormDesign myFormDesign);

    List<MyFormDesign> findList(MyFormDesign myFormDesign);

    MyFormDesign findById(String id);

    boolean add(MyFormDesign myFormDesign);

    boolean update(MyFormDesign myFormDesign);

    boolean delete(String id);

    JSONArray findPropertiesById(String id);

    JSONObject findFormByKey(String processDefinitionKey, String businessId);

    JSONObject findFormByTaskId(String taskId);

    JSONObject findFormByProcessInstanceId(String processInstanceId);

    JSONObject findFormByBusinessId(String code, String business_id);

    Boolean findFormIsExistByProcessInstanceId(String processInstanceId);

    Boolean findFormIsExistByBusinessId(String code, String business_id);

    List<FormProperty> findFormFieldByKey(String processDefinitionKey, String taskId);

}
